Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Drawing a Viewer and its Contents

This section describes the routines you can use to draw a viewer object and its contents.

Q3ViewerDraw

You can use the Q3ViewerDraw function to draw a viewer object.

MAC OS VERSION

OSErr Q3ViewerDraw (TQ3ViewerObject theViewer);

WINDOWS VERSION

TQ3Status Q3WinViewerDraw (TQ3ViewerObject viewer);

PARAMETER

theViewer
A viewer object.

DESCRIPTION

The Q3ViewerDraw function draws the viewer object specified by the theViewer parameter. You need to call this function only if the viewer flags or other visible features of a viewer have changed. For example, to change a viewer's pane, you need to call Q3ViewerSetBounds followed by Q3ViewerDraw . Similarly, if the viewer flags of a new viewer object have the kQ3ViewerActive flag clear, then to make the viewer object active you need to set that flag by calling Q3ViewerSetFlags and then draw the viewer object by calling Q3ViewerDraw .

Q3ViewerDrawContent

You can use the Q3ViewerDrawContent function to draw the content region of a viewer object.

MAC OS VERSION

OSErr Q3ViewerDrawContent (TQ3ViewerObject theViewer);

WINDOWS VERSION

TQ3Status Q3WinViewerDrawContent (TQ3ViewerObject viewer);

PARAMETER

theViewer
A viewer object.

DESCRIPTION

The Q3ViewerDrawContent function forces the 3D Viewer to rerender and redraw the 3D data displayed in the content region of the viewer object specified by the theViewer parameter. You should call Q3ViewerDrawContent only if you have directly modified the model associated with that viewer object using QuickDraw 3D functions. Q3ViewerDrawContent redraws only the content region of the viewer object and is preferable to calling Q3ViewerDraw , which also redraws the controller strip and other user interface elements.

SPECIAL CONSIDERATIONS

The Q3ViewerDrawContent function is available only in versions 1.1 and later of the 3D Viewer.

Q3ViewerDrawControlStrip

You can use the Q3ViewerDrawControlStrip function to draw the controller strip and other user interface elements of a viewer object.

MAC OS VERSION

OSErr Q3ViewerDrawControlStrip (TQ3ViewerObject theViewer);

WINDOWS VERSION

TQ3Status Q3WinViewerDrawControlStrip (TQ3ViewerObject viewer);

PARAMETER

theViewer
A viewer object.

DESCRIPTION

The Q3ViewerDrawControlStrip function forces the 3D Viewer to redraw the controller strip and other user interface elements of the viewer object specified by the theViewer parameter. (The user interface elements of a viewer object are its controller strip, its badge, and its drag border.) You might use Q3ViewerDrawControlStrip when you want to update the controller strip but do not want to rerender and redraw the model in the content region of the viewer object.

SPECIAL CONSIDERATIONS

The Q3ViewerDrawControlStrip function is available only in versions 1.1 and later of the 3D Viewer.

Q3ViewerSetDrawingCallbackMethod

You can use the Q3ViewerSetDrawingCallbackMethod function to set a drawing completion callback routine for a viewer object. This function has no equivalent in the Windows environment.

OSErr Q3ViewerSetDrawingCallbackMethod (
                     TQ3ViewerObject theViewer,
                     TQ3ViewerDrawingCallbackMethod callbackMethod,
                     const void *data);
theViewer
A viewer object.
callbackMethod
A pointer to the drawing completion callback routine for the specified viewer object. See TQ3ViewerDrawingCallbackMethod for a description of this routine.
data
A pointer to an application-defined block of data. This pointer is passed to the callback routine when it is called.

DESCRIPTION

The Q3ViewerSetDrawingCallbackMethod function registers the function pointed to by the callbackMethod parameter as a drawing completion callback routine for the viewer object specified by the theViewer parameter. This callback routine is called each time the 3D Viewer completes a drawing operation requested by a call to Q3ViewerDraw , Q3ViewerDrawContent , or Q3ViewerDrawControlStrip .

You can use a callback routine to perform any operations that should follow a completed drawing operation. For instance, if a viewer is associated with an offscreen graphics world, you can use the drawing completion callback routine to copy the rendered image to its final destination.

SPECIAL CONSIDERATIONS

The Q3ViewerSetDrawingCallbackMethod function is available only in versions 1.1 and later of the 3D Viewer.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |